package com.nescafe.nescafepromo.controller;

import com.nescafe.nescafepromo.command.Command;
import com.nescafe.nescafepromo.command.CommandType;
import com.nescafe.nescafepromo.command.admin.AddPurchase;
import com.nescafe.nescafepromo.command.admin.DrawWinners;
import com.nescafe.nescafepromo.command.admin.SearchExtraPoints;
import com.nescafe.nescafepromo.command.admin.SearchParticipants;
import com.nescafe.nescafepromo.command.admin.SearchPaypalPurchases;
import com.nescafe.nescafepromo.command.admin.SearchPurchases;
import com.nescafe.nescafepromo.model.NPRequest;

public class AdminController extends Controller {

	@Override
	protected void escapeCharacters(NPRequest req) throws ControllerException {
		// TODO Auto-generated method stub

	}

	@Override
	protected void validate(NPRequest req) throws ControllerException {
		// TODO Auto-generated method stub

	}

	@Override
	protected Command getCommand(CommandType commandType) throws ControllerException {
		Command com = null;
		switch (commandType) {
			case ADD_PURCAHSE:
				com = new AddPurchase();
				break;
			case SEARCH_PURCHASES :
				com = new SearchPurchases();
				break;
			case SEARCH_PARTICIPANTS:
				com = new SearchParticipants();
				break;
			case SEARCH_PAYPAL_PURCHASES:
				com = new SearchPaypalPurchases();
				break;
			case SEARCH_EXTRA_POINTS:
				com = new SearchExtraPoints();
				break;
			case DRAW_WINNERS:
				com = new DrawWinners();
				break;
			default :
				throw new ControllerException("invalid command");
		
		}
		return com;
	}

}
